/**
 * 
 */
package com.ys.life0736.system.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;

/**
 * 权限
 * 
 * @author
 * 
 * @creatTime 2012-11-20 下午8:11:35
 * @since
 * @version 0.1beat
 */
@Entity
@Table(name = "s_authority")
public class Authority implements Serializable {

	private static final long serialVersionUID = 8058516158682131090L;

	@Id
	@Column(name = "a_id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer aid;
	@Column(name = "a_name", length = 15)
	private String aname;
	/**
	 * 权限描述
	 */
	@Column(name = "a_desc", length = 100)
	private String describe;
	@ManyToMany(cascade = { CascadeType.REFRESH }, fetch = FetchType.LAZY, mappedBy = "authorities")
	private List<Role> roles = new ArrayList<Role>();

	/**
	 * @return the aid
	 */
	public Integer getAid() {
		return aid;
	}

	/**
	 * @param aid
	 *            the aid to set
	 */
	public void setAid(Integer aid) {
		this.aid = aid;
	}

	/**
	 * @return the aname
	 */
	public String getAname() {
		return aname;
	}

	/**
	 * @param aname
	 *            the aname to set
	 */
	public void setAname(String aname) {
		this.aname = aname;
	}

	/**
	 * @return the describe
	 */
	public String getDescribe() {
		return describe;
	}

	/**
	 * @param describe
	 *            the describe to set
	 */
	public void setDescribe(String describe) {
		this.describe = describe;
	}

	/**
	 * @return the roles
	 */
	public List<Role> getRoles() {
		return roles;
	}

	/**
	 * @param roles
	 *            the roles to set
	 */
	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

}
